package com.storage.control
{
	import com.firemoss.modelglue.controller.ModelGlueController;
	import com.firemoss.modelglue.event.ModelGlueEvent;
	import com.storage.model.AppModelLocator;
	import com.storage.view.container.OrderLayout;
	import com.zzkj.view.widgets.InnerTab;
	
	import mx.collections.ArrayCollection;

	public class BuyOrderController extends ModelGlueController
	{
		[Bindable]
		public var model:AppModelLocator = AppModelLocator.getInstance();
		
		public function BuyOrderController()
		{
			super();
		}
		
		
		public function changeToBuyOrder(e:ModelGlueEvent):void{
			var pas:Array = e.getValue("selectItems") as Array;
			var tab:InnerTab = e.getValue("tab") as InnerTab;
			var panel:OrderLayout = model.displayPageDic['buyOrderPanels'];
			if(panel==null){
				panel = new OrderLayout();
				
				panel.percentHeight = 100;
				panel.percentWidth = 100;
				model.displayPageDic['buyOrderPanels'] = panel;
			}
				
			var ay:ArrayCollection = new ArrayCollection();
			ay.source = pas;
			panel.orderArray = ay ;
			
			tab.next = panel;
			var me:ModelGlueEvent = new ModelGlueEvent('playChangeEffect');
			me.setValue('lab','申购订单');
			me.setValue('begin',tab.current);
			me.setValue('end',tab.next);
			me.setValue('type','CubeRotate');
			me.dispatch();
		}
		
	}
}